<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<div class="art_list">
	<!-- 编辑时动态触发 【start】-->
	<div class="mod_toolbar" id="tb_mb_article_list1"
		style="display: none; height: 28px; position: absolute; right: 2px; background: none repeat scroll 0% 0% rgb(247, 182, 75); width: 70px;">
		<a
			onclick="popup_window(&#39;admin/index.php?_m=mod_article&amp;_a=admin_list&#39;,&#39;文章列表  内容编辑&#39;,&#39;&#39;,500,true);return false;"
			title="内容编辑" href="#"><img border="0" alt="内容编辑"
				src="<%=basePath%>news/edit_content.gif" />&nbsp;内容编辑</a>
	</div>
	<!-- 编辑时动态触发 【end】-->
	<div class="art_list_title">
		<s:property value="%{getText('News_All_Articles')}" />
	</div>
	<div class="art_list_search">
		<form name="prdsearchform" id="prdsearchform"
			onsubmit="javascript:return check_prdsearch_info(this);"
			action="newsSearch.action" method="post">
			<input type="text" name="newsWhat" id="newsWhat" value="">
			<input type="hidden" name="newsFun" id="newsFun" value="">
			<input type="hidden" name="dateError" id="dateError"
				value="<s:property value="%{getText('Date_Error')}"/>">
			<input type="hidden" name="searchError" id="searchError"
				value="<s:property value="%{getText('Search_Error')}"/>">
			<select id="fun">
				<option value="date">
					<s:property value="%{getText('Date')}" />
				</option>
				<option value="name">
					<s:property value="%{getText('Name')}" />
				</option>
				<option value="type">
					<s:property value="%{getText('Type')}" />
				</option>
			</select>
			<input type="submit" name="prdsearch_submit" id="prdsearch_submit"
				value="<s:property value="%{getText('Search')}"/>">
		</form>
		<script type="text/javascript" language="javascript">
<!--
function check_prdsearch_info(thisForm)
{
if (/^\s*$/.test(thisForm.elements["newsWhat"].value))
{
	alert($("#searchError").val());
	thisForm.elements["newsWhat"].focus();
	return false;
}
var dateReg=new RegExp("(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29)");
var fun=$("#fun").val();
var value=$("#newsWhat").val();
if(fun=="date"){
	if(!dateReg.test(value)){
		alert($("#dateError").val()+"：YYYY-MM-DD");
		return false;
	}
}
$("#newsFun").val(fun);
return true;
}
-->
</script>
	</div>
	<div class="art_list_con">
		<ul>
			<c:choose>
				<c:when test="${empty news}">
					<s:property value="%{getText('News_All_Articles_Null')}" />
				</c:when>
				<c:otherwise>
					<c:forEach items="${news}" var="new">
						<li>
							<p class="l_title">
								<a href="<%=basePath%>NewsView.action?newsId=${new.id }"
									title="${new.title }">${new.abstracts }</a>
							</p>
							<p class="n_time">
								<f:formatDate value="${new.createDate }"
									pattern="yyyy-MM-dd HH:mm" />
							</p>
						</li>
					</c:forEach>
				</c:otherwise>
			</c:choose>
		</ul>
	</div>
	<img alt="" src="<%=basePath%>share/images/bag_30.jpg">
	<style type="text/css">
#pagerwrapper {
	padding: 0 15px;
	width: 98%;
}

#pagerwrapper table td {
	padding-right: 10px;
}

#pagerwrapper .pageinput {
	width: 18px;
	_width: 18px
}

#pagerwrapper .page_square {
	width: 15px;
	height: 13px;
	_width: 15px;
	_height: 13px;
	background-color: #FAFDFC;
	border: 1px #F6F4F2 solid;
	padding: 0 3px;
	_padding: 0 3px;
	margin: 0 3px;
	_margin: 0 3px;
}

#pagerwrapper .page_square_bg {
	width: 15px;
	height: 13px;
	_width: 15px;
	_height: 13px;
	background-color: #0468B4;
	border: 1px #F6F4F2 solid;
	padding: 0 3px;
	_padding: 0 3px;
}

#pagerwrapper .page_word {
	width: 50px;
	height: 13px;
	_width: 50px;
	_height: 13px;
	background-color: #FAFDFC;
	border: 1px #F6F4F2 solid;
	padding: 0 3px;
	_padding: 0 3px;
	margin: 0 3px;
	_margin: 0 3px;
}

#pagerwrapper a {
	color: #0089D1
}

.page_sure {
	width: 50px;
	_width: 50px;
	border-left: #CCCCCC 1px solid;
	border-top: #CCCCCC 1px solid;
	border-right: #999999 1px solid;
	border-bottom: #999999 1px solid;
	background-color: #00CCFF;
}
</style>
	<script language="javascript">
function pageLocation() {
	var p_v = $("#p").val();
	if (p_v == "") {
		alert($("#error1").val());
		return false;
	}
	if (!(p_v.match(/\d/))) {
		alert($("#error2").val());
		return false;
	}
	var zys=$("#zys").val();
	var cid=$("#cid").val();
	if(parseInt(p_v)>parseInt(zys)){
		alert($("#error3").val());
		return false;
	}
	window.location ="?newsPage="+p_v+"&categoryId="+cid;
}
</script>
	<div id="pagerwrapper">
		<table id="pager" cellspacing="0">
			<tbody>
				<c:if test="${!empty news}">
					<tr>
						<td colspan="5">
							<a href="?newsPage=1&categoryId=${fenye.cid }" class="page_word"><s:property
									value="%{getText('Navigation1')}" /> </a>&nbsp;&nbsp;
							<a href="?newsPage=${fenye.upPage}&categoryId=${fenye.cid }"
								class="page_word"><s:property value="%{getText('Up_Page')}" />
							</a>&nbsp;
							<!-- <a href="1" class="page_square_bg"><font color="white">1</font></a> -->
							<c:forEach var="ye" begin="${fenye.begin}" end="${fenye.end}">
								<c:choose>
									<c:when test="${fenye.ye==0}">
										<c:choose>
											<c:when test="${ye==fenye.ye+1}">
												<a class="page_square_bg"><font color="white">${ye
														}</font> </a>&nbsp;
										</c:when>
											<c:otherwise>
												<a href="?newsPage=${ye }&categoryId=${fenye.cid }"
													class="page_square">${ye }</a>&nbsp;
										</c:otherwise>
										</c:choose>
									</c:when>
									<c:otherwise>
										<c:choose>
											<c:when test="${ye==fenye.ye}">
												<a class="page_square_bg"><font color="white">${ye
														}</font> </a>&nbsp;
										</c:when>
											<c:otherwise>
												<a href="?newsPage=${ye }&categoryId=${fenye.cid }"
													class="page_square">${ye }</a>&nbsp;
										</c:otherwise>
										</c:choose>
									</c:otherwise>
								</c:choose>

							</c:forEach>
							<c:choose>
								<c:when test="${fenye.nextPage==fenye.zys}">
									<a href="?newsPage=${fenye.zys}&categoryId=${fenye.cid }"
										class="page_word"><s:property
											value="%{getText('Down_Page')}" /> </a>&nbsp;&nbsp;
						</c:when>
								<c:otherwise>
									<c:choose>
										<c:when test="${fenye.nextPage==1}">
											<a href="?newsPage=2&categoryId=${fenye.cid }"
												class="page_word"><s:property
													value="%{getText('Down_Page')}" /> </a>&nbsp;&nbsp;
							</c:when>
										<c:otherwise>
											<a
												href="?newsPage=${fenye.nextPage}&categoryId=${fenye.cid }"
												class="page_word"><s:property
													value="%{getText('Down_Page')}" /> </a>&nbsp;&nbsp;
							</c:otherwise>
									</c:choose>
								</c:otherwise>
							</c:choose>
							<a href="?newsPage=${fenye.zys}&categoryId=${fenye.cid }"
								class="page_word"><s:property
									value="%{getText('Last_Page')}" /> </a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<s:property value="%{getText('Jump_Page')}" />
							：
							<input type="text" name="p" id="p" value="" class="pageinput">
							&nbsp;
							<s:property value="%{getText('Page')}" />
							&nbsp;&nbsp;&nbsp;&nbsp;
							<a href="javascript:pageLocation()" class="page_sure">&nbsp;<s:property
									value="%{getText('Ok')}" />&nbsp;</a>
							<input type="hidden" name="zys" id="zys" value="${fenye.zys }">
							<input type="hidden" name="cid" id="cid" value="${fenye.cid }">
							<input type="hidden" name="error1" id="error1"
								value="<s:property value="%{getText('News_All_Articles_Error1')}"/>">
							<input type="hidden" name="error2" id="error2"
								value="<s:property value="%{getText('News_All_Articles_Error2')}"/>">
							<input type="hidden" name="error3" id="error3"
								value="<s:property value="%{getText('News_All_Articles_Error3')}"/>">
						</td>
					</tr>
				</c:if>
			</tbody>
		</table>
	</div>
</div>